package com.example.roomtest.ui

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.example.roomtest.R
import java.util.zip.Inflater

/**
 *@author : Administrator
 *@descreption :
 */
class MyAdapter:RecyclerView.Adapter<MyAdapter.MyHoder>(){
    class MyHoder(view: View):RecyclerView.ViewHolder(view){
        var textView:TextView?=view.findViewById(R.id.text)

    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyHoder {
     val view =  LayoutInflater.from(parent.context).inflate(R.layout.item,parent,false)
        return MyHoder(view)
    }

    override fun getItemCount(): Int {
        return 50
    }

    override fun onBindViewHolder(holder: MyHoder, position: Int) {
       holder.textView?.text = "这是第${position.toString()}个"
    }
}